{% load i18n %}
{% load staticfiles %}

<!DOCTYPE html>
<html lang="en">
	<head>
	{% include 'main/top.html' %}
	<script type="text/javascript" src="/static/js/base.js"></script>
	<title>网页图片页面</title>
	</head>
<body>
		
<div class="container-fluid" id="main-container">
<input type="hidden" id="img_type" name="img_type" value="{{img_type|default_if_none:''}}"/>

<div id="page-content" class="clearfix">
						
  <div class="row-fluid">

	<div class="row-fluid">
	 
		
			<table id="table_report" class="table table-striped table-bordered table-hover">
				
				<thead>
					<tr>
						<th class="center">图片名称</th>
						<th class="center">链接</th>
						<th class="center">展示顺序</th>
						<th class="center">图片位置</th>
						<th class="center">尺寸</th>
						<th class="center">操作</th>
					</tr>
				</thead>
										
				<tbody>
				{% if img_list %}
					{% for webimg in img_list %}
							<tr>
								<td class='center'>{{webimg.name|default_if_none:''}}</td> 
								<td class='center'>{{webimg.href|default_if_none:''}}</td> 
								<td class='center'>{{webimg.sort|default_if_none:''}}</td> 
								<td class='center'>{{webimg.get_type_display}}</td> 
								<td class='center'>{{webimg.meansure|default_if_none:''}}</td> 
								 	
								<td class="center">
									<a class="btn btn-mini btn-info" onclick="updatevisitimg({{webimg.id}});">修改</a>
								</td>

							</tr>
					{% endfor %} 
					{% else %}
						<tr class="main_info">
							<td colspan="100" class="center" >没有相关数据</td>
						</tr>
					{% endif %}
				
				</tbody>
			</table>
			
		 
	<!-- PAGE CONTENT ENDS HERE -->
  </div><!--/row-->
	
</div><!--/#page-content-->
</div><!--/.fluid-container#main-container-->
		
		<!-- 返回顶部  -->
		<a href="#" id="btn-scroll-up" class="btn btn-small btn-inverse">
			<i class="icon-double-angle-up icon-only"></i>
		</a>
		
		<!-- 引入 -->
		<script type="text/javascript">window.jQuery || document.write("<script src='static/js/jquery-1.9.1.min.js'>\x3C/script>");</script>
		<script src="/static/js/bootstrap.min.js"></script>
		<script src="/static/js/ace-elements.min.js"></script>
		<script src="/static/js/ace.min.js"></script>
		
		<script type="text/javascript" src="/static/js/chosen.jquery.min.js"></script><!-- 下拉框 -->
		<script type="text/javascript" src="/static/js/bootstrap-datepicker.min.js"></script><!-- 日期框 -->
		<script type="text/javascript" src="/static/js/bootbox.min.js"></script><!-- 确认窗口 -->
		<!-- 引入 -->
		<script type="text/javascript" src="/static/js/jquery.tips.js"></script><!--提示框-->
		<script type="text/javascript">
		
		function nextPage(type){
			top.jzts();
			pagenumAct = $("#pagenum").val();
			numpage = $("#numpage").val();
			if (pagenumAct == null || pagenumAct== "")
				pagenumAct=1;
			if (numpage == null || numpage== "")
				numpage=1;
			numpage = parseInt(numpage);
			pagenumAct = parseInt(pagenumAct);
			pagenum=1
			if (type == 1){
				if (pagenumAct==1){
					alert("当前已经是首页!");
					top.hangge();
					return;
				}
				
			}else if (type == 2){
				if (pagenumAct==1){
					alert("当前已经是第一页!");
					top.hangge();
					return;
				}
				pagenum = pagenumAct-1
			}else if (type == 3){
				if (pagenumAct==numpage){
					alert("当前已经是最后一页了!");
					top.hangge();
					return;
				}
				pagenum = pagenumAct+1
			}else if (type == 4){
				if (pagenumAct==numpage){
					alert("当前已经是尾页了!");
					top.hangge();
					return;
				}
				pagenum = numpage
			}
			$("#pagenum").val(pagenum);
			$("#Form").submit();
		}
		function changeCount(value){ 
			top.jzts();	
			pagecount = $("#pagecount").val();
			if (pagecount == null || pagecount== "")
				pagecount=10;
			pagecount = parseInt(pagecount);
			if (pagecount == value){
				alert("每页条数未修改!");
				top.hangge();
				return;
			}
			$("#pagenum").val(1);
			$("#pagecount").val(value);
			$("#numpage").val(1);
			$("#Form").submit();
		}
		function toTZ(){
			var toPaggeVlue = document.getElementById("toGoPage").value;
			if(toPaggeVlue == ''){
				document.getElementById("toGoPage").value=1;
				return;
			}
			if(isNaN(Number(toPaggeVlue))){
				document.getElementById("toGoPage").value=1;
				return;
			}
			nextPage(toPaggeVlue);
		}
		
		
		$(top.hangge());
		
		//检索
		function search(){
			top.jzts();
			$("#Form").submit();
		}
		
		
		
		</script>
		
		<script type="text/javascript">
		
		$(function() {
			pagecount = $("#pagecount").val();
			pagecount = parseInt(pagecount);
			 
			$("#selectpageCount").attr("value",pagecount);
			//下拉框
			$(".chzn-select").chosen(); 
			$(".chzn-select-deselect").chosen({allow_single_deselect:true}); 
			
			//日期框
			$('.date-picker').datepicker();
			
			//复选框
			$('table th input:checkbox').on('click' , function(){
				var that = this;
				$(this).closest('table').find('tr > td:first-child input:checkbox')
				.each(function(){
					this.checked = that.checked;
					$(this).closest('tr').toggleClass('selected');
				});
					
			});
			var val = $("#statusold").val();
			if (val != null && val != ""){
				$("#status").attr("value",val);
				$("#status").trigger("liszt:updated");
			}
		});
		 
		
		//导出excel
		function toExcel(){
			window.location.href='<%=basePath%>textmsg/excel.do';
		}
		$(top.hangge());
		</script>
		
	</body>
</html>

